import React, { Component } from 'react'
import axios from '../utils/request'
import '../App.css'

export default class Topic extends Component {
    state = {
        list: []
    }

    componentDidMount() {
        axios({
            url: '/getlist',
            method: 'post'
        }).then(res => {
            this.setState({
                list: res.data.data
            })
        })
    }
    render() {
        const { list } = this.state
        return (
            <div className='topic'>
                <div className='topic_one'>
                    {
                        list.length && list.map((item, index) => {
                            return <div className='topic_two' key={index}>
                                <div className='topic_two_1'>
                                    <img src={item.img1}></img>
                                    <div>
                                        <li><span>{item.name}</span>&emsp;<span className='span_1'>{item.solp}</span>&emsp;<span  className='span_1'>{item.slie}</span></li>
                                        <li><span className='span_3'>原创</span>&emsp;<span className="span_2">{item.time}</span></li>
                                    </div>
                                </div>
                                <div className='topic_two_2'>
                                    <li>{item.skin}</li>
                                    <li>{item.cope}</li>
                                </div>
                            </div>
                        })
                    }
                </div>
            </div>
        )
    }
}
